package com.visceb.backstage.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import com.visceb.backstage.entity.User;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
//springboot使用jpa,spring data jpa
public interface userRepository extends JpaRepository<User, Long>{
//    User findById(int id);
    User findByNameAndId(String name, String id);
    User findBySex(String sex);
    User findByUsername(String username);


    @Query(nativeQuery = true,value = "select * from user where id>=1 ")
    List<User> getAllUser();

}
